#ifndef _OH_DROID_H
#define	_OH_DROID_H
/*******************************************************************************
 **  Name: droid.h                                                            **
 **  Description:                                                             **
 **                                                                           **
 **  CDDL: Open Source Initiative (OSI) Approved License                      **
 **                                                                           **
 **  Copyright (c) 2009-2010 Barry "Gian" James  <bjames@munixos.net>         **
 **  All rights reserved.                                                     **
 **                                                                           **
 **  The contents of this file are subject to the terms of the CDDL:          **
 **  Common Development and Distribution License (the "License").             **
 **  You may not use this file except in compliance with the License.         **
 **                                                                           **
 **  You can obtain a copy of the license at $PROJECT_ROOT/LICENSE            **
 **  or http://www.opensolaris.org/os/licensing.  This code is Open Source    **
 **  and you are free to use it within the confines of the license, even      **
 **  for your own closed-source commercial projects, as long as you follow    **
 **  the terms set forth in the CDDL.                                         **
 **                                                                           **
 **  When distributing Covered Code, include this CDDL HEADER in each         **
 **  file and include the License file at $PROJECT_ROOT/LICENSE.              **
 **  If applicable, add the following below this CDDL HEADER, with the        **
 **  fields enclosed by brackets "[]" replaced with your own identifying      **
 **  information: Portions Copyright [yyyy] [name of copyright owner]         **
 **                                                                           **
 ******************************************************************************/
// Modified $DateTime$ by $Author$
#define _droid_h_ID    "$Id$"

#include "common.h"
#include "model.h"
#include "pilot.h"
#include "equipment.h"
#include "weapon.h"

#define MAX_DROID_NAME  32

enum class base : uint8 { energy, mobility, computation, memory, communication, stats };
enum class derived : uint8 { defense, handling, initiative, attack, stats };
// stats have 3 values: normal, current, and temporary
enum class statOpts { normal, current, temp };

enum class Signatures { radar, radio, sonar, thermal, visual, max };
struct DroidSignature
{
    int8           defDC[(int)Signatures::max]; // signature defense/DC per signature
    int8           mods[(int)Signatures::max]; // any gear/talent/stat mods
};

class BattleDroid {
public:
    BattleDroid();
    ~BattleDroid();


private:
    char    name[MAX_DROID_NAME];
    Model   model;      // what model droid
    Pilot   pilot;

    uint8   verMaj;     // this is your level
    uint32  xp;
    uint8   verMin;     // upgrades

    // Base stats [0..250]
    uint8   baseStats[(uint8)base::stats][3];
    uint8   derivedStats[(uint8)derived::stats][3];

    uint8   speed;
	uint8	weight;

    // Classic saving throws
    uint8   structure;  // save against physical damage
    uint8   electronic; // save against electronic damage
	uint8	software;	// save against software damage

    DroidSignature  sig;

    Direction   facing; // what direction are we facing?

    uint32  id;         // droid's unique in-game ID
    static uint32 nextID;
    static uint32 NextID() { return (++nextID); }
    
};

#endif	/* _OH_DROID_H */

